package com.smartcommunity.controller.waterEleGas;

import com.smartcommunity.bean.model.Pager;
import com.smartcommunity.entity.waterEleGasUsage.req.HouseWaterEleGasUsageReq;
import com.smartcommunity.entity.waterEleGasUsage.req.HouseWaterEleGasUsageStatisticReq;
import com.smartcommunity.entity.waterEleGasUsage.req.VillageWaterEleGasPageReq;
import com.smartcommunity.entity.waterEleGasUsage.resp.HouseWaterEleGasUsageResp;
import com.smartcommunity.entity.waterEleGasUsage.resp.HouseWaterEleGasUsageStatisticResp;
import com.smartcommunity.entity.waterEleGasUsage.resp.VillageWaterEleGasPageResp;
import com.smartcommunity.service.waterEleGasUsage.WaterEleGasUsageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author nieming
 * @descrition 水电气控制器
 * @date 2020/5/12
 */
@RestController
@RequestMapping(value = "/waterGasEle")
@Api(value = "水电气", tags = "水电气")
@Slf4j
public class WaterEleGasUsageController {
    @Autowired
    private WaterEleGasUsageService waterEleGasUsageService;

    @PostMapping(value = "/queryVillageUsage")
    @ApiOperation(value = "查询小区水电气使用信息", notes = "查询小区水电气使用信息")
    public Pager<VillageWaterEleGasPageResp> queryVillageUsage(@RequestBody VillageWaterEleGasPageReq villageWaterEleGasPageReq) {
        return waterEleGasUsageService.queryVillageUsage(villageWaterEleGasPageReq);
    }
    @PostMapping(value = "/queryHouseUsage")
    @ApiOperation(value = "根据小区查询小区内房屋水电气使用信息", notes = "根据小区查询小区内房屋水电气使用信息")
    public Pager<HouseWaterEleGasUsageResp> queryHouseUsage(@RequestBody HouseWaterEleGasUsageReq villageWaterEleGasPageReq) {
        return waterEleGasUsageService.queryHouseUsage(villageWaterEleGasPageReq);
    }
    @PostMapping(value = "/houseUsageStatistic")
    @ApiOperation(value = "房屋水电气使用信息统计", notes = "房屋水电气使用信息统计")
    public List<HouseWaterEleGasUsageStatisticResp> houseUsageStatistic(@RequestBody HouseWaterEleGasUsageStatisticReq villageWaterEleGasPageReq) {
        return waterEleGasUsageService.houseUsageStatistic(villageWaterEleGasPageReq);
    }


}
